﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace BOM
{
    public partial class CheckAdmin : Form
    {
        public CheckAdmin()
        {
            InitializeComponent();
        }

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            //写校验密码代码段
            String password = txtPassword.Text.Trim();
            String sql = "select id from userRole where username='admin' and password='"+password+"'";
            DataTable ds = dao.DbService.getSQLTable(sql, "user");
            if (ds == null || ds.Rows.Count == 0)
            {
                MessageBox.Show(this,"校验密码不正确！");
            }
            else
            this.DialogResult = DialogResult.OK;

            this.Close();
        }
    }
}
